<template>
  <div class='charts' ref='charts'></div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'lineChart',
  mounted () {
    // 准备宽高容器 初始化实例
    let lineCharts = echarts.init (this.$refs.charts)
    lineCharts.setOption ({
      xAxis: {
        show: false,
        type: 'category'
      },
      yAxis: {
        show: false
      },
      series: [
       {
          type: 'line',
          data: [12,34,25,45,27,19,30,7,10,7,34],
          itemStyle: {
            opacity: 0
          },
          lineStyle: {
            color: 'blue'
          },
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                  offset: 0, color: 'blue' // 0% 处的颜色
              }, {
                  offset: 1, color: '#fff' // 100% 处的颜色
              }],
              global: false // 缺省为 false
            }
          },
          smooth: true
       }
      ],
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      }
    })
    
  }
}
</script>

<style scoped>
  .charts {
    height: 100%;
    width: 100%;
  }
</style>
